package cn.tedu.imop.mq;

import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.ExchangeBuilder;
import org.springframework.amqp.core.QueueBuilder;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class ConsumerApplication {
    public static void main(String[] args) {
        SpringApplication.run(ConsumerApplication.class, args);
    }
    @Bean
    public org.springframework.amqp.core.Queue lazeQueue() {
        System.out.println("创建延迟队列");
        return QueueBuilder.durable("lazy.queue1")
                .lazy()
                .build();
    }
//    @Bean
//    public DirectExchange delayExchange() {
//        return ExchangeBuilder
//                .directExchange("delay.direct")
//                .delayed().build();
//    }

}
